﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using NeuronDotNet.Controls;

namespace NeuronDotNet.Samples.OCR.layoutsstategies
{
    public class FixedStrategy : LayoutStrategy
    {
        int n;

        public FixedStrategy(Rectangle imageRect, int n)
            : base(imageRect)
        {
            this.n = n;
        }

        public override List<Rectangle> GetDivision()
        {
            List<Rectangle> rects = new List<Rectangle>();

            int partWidth = imageRect.Width / n;

            for (int i = 0; i < n; i++)
            {
                Rectangle rect = new Rectangle(imageRect.Left + i * partWidth, imageRect.Top, partWidth, imageRect.Height);
                rects.Add(rect);
            }

            return rects;
        }
    }
}
